import React,{ useEffect, useState } from 'react';
import '../../assets/css/questions/questions.css'
import {getNews} from '../../apis/news'
import {baceUrl} from '../../utils/config'

function Particulars(props:any) {
  const [list,setList] = useState<any>([])
  const getlist = async()=>{
    let res:any = await getNews({id:props.getOpen})
    console.log(res)
    if(res.errCode === 10000){
      setList(res.data)
    }
  }
  useEffect(()=>{
    getlist()
  },[])
  console.log(props)
    return (
      <div>
        <div className='announcement'>公告详情</div>
        <div className='name size'>{list.title}</div>
        <div className='time size'>
        {/* <img className='imgs' src="../../assets/images/time.jpg" alt="" /> */}
          <p className='gray'>添加时间: </p>
          {list.addtime}
        </div>
        <div>
          <img className='image' src={baceUrl + list.picture} alt="" />
        </div>
        <div className='gray size'>
          {list.content}
        </div>
      </div>
    );
}

export default Particulars;
